package com.dongwu.common.dto;

import java.io.Serializable;
import java.util.List;

public class PagingVO implements Serializable {

	private List rows;
	private int total;
	private int currentPage;
	private int totalPage;
	private int pageSize;
	private int rowIndexStart;
	private int rowIndexEnd;

	public PagingVO() {
	}

	public PagingVO(List rows, int total) {
		this.rows = rows;
		this.total = total;
	}

	public PagingVO(List rows, int total, int currentPage, int pageSize) {
		this.rows = rows;
		this.total = total;
		this.currentPage = currentPage;
		this.pageSize = pageSize;
		this.totalPage = (total + pageSize - 1) / pageSize;
		this.rowIndexStart = (currentPage - 1) * pageSize + 1;
		this.rowIndexEnd = rowIndexStart + rows.size() - 1;
		
	}
	public List getRows() {
		return rows;
	}

	public void setRows(List rows) {
		this.rows = rows;
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

	public int getTotalPage() {
		return totalPage;
	}

	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getRowIndexStart() {
		return rowIndexStart;
	}

	public void setRowIndexStart(int rowIndexStart) {
		this.rowIndexStart = rowIndexStart;
	}

	public int getRowIndexEnd() {
		return rowIndexEnd;
	}

	public void setRowIndexEnd(int rowIndexEnd) {
		this.rowIndexEnd = rowIndexEnd;
	}
	
	
}
